<me:UIMJOB  x:Class="WPFExcelReport.TFMJOBS"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
         xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
         xmlns:me="clr-namespace:WPFExcelReport" 
            xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"   
             xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
         Loaded="Window_Loaded" 
           Background="DarkGray" 
        x:Name="TV"
 >
    <me:UIMJOB.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:Divideby1440  x:Key="day"/>
        <ucd:Divideby480  x:Key="shift"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTConverter x:Key="not"/>
    </me:UIMJOB.Resources> 
    <StackPanel>
        <WrapPanel> 
            <Button Height="20" Width="24"      Margin="10,0,0,0"  Click="EditCommand" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                </Button.Background>
            </Button>
            <Button Height="20" Width="24"      Margin="10,0,0,0"  Click="SaveCommand" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                </Button.Background>
            </Button>

        </WrapPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0"    HorizontalAlignment="Right"  
                           Margin="0,0,0,0"    VerticalAlignment="Center"   Width="Auto"   TextAlignment="Right"   Text="{Binding Source={Localization:Translate Word=ID:}}" />
                <TextBlock  Grid.Row="0" Grid.Column="1"   HorizontalAlignment="Left" 
                            TextWrapping="Wrap"   Text="{Binding ABAID}"   VerticalAlignment="Top" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="2" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=类型:}}"  HorizontalAlignment="Right"   Height="18"      TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <TextBlock Grid.Row="2" Grid.Column="1"    Text="{Binding JOBTYPE, Mode=TwoWay}" 
                           VerticalAlignment="Top" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="1" Grid.Column="0"   HorizontalAlignment="Right"   Height="18"      TextWrapping="Wrap"   VerticalAlignment="Top"   TextAlignment="Right"   Text="{Binding Source={Localization:Translate Word=单号:}}" />
                <WrapPanel Grid.Row="1" Grid.Column="1" >
                    <TextBlock    Text="{Binding ABFAUFKRS}"   VerticalAlignment="Top" />
                    <TextBlock    Text="{Binding ABFAUFLFD}"   VerticalAlignment="Top" />
                    <TextBlock    Text="{Binding ABFAUFPOS}"   VerticalAlignment="Top" />
                </WrapPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="2" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=任务号:}}"  HorizontalAlignment="Right"   Height="18"      TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <TextBlock Grid.Row="2" Grid.Column="1"    Text="{Binding MKFTP}"  
                           VerticalAlignment="Top" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="6" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=任务:}}"  HorizontalAlignment="Right"   Height="18"   
                           TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <ex:TXT72 Grid.Row="6" Grid.Column="1"  
                          Text="{Binding ABPART,Converter={StaticResource gb2312}, Mode=TwoWay}"  
                          MaxLength="20" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                         VerticalAlignment="Top"  Width="100"  />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="3" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=设备:}}"  HorizontalAlignment="Right"   Height="18"     
                           TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <WrapPanel Grid.Row="3" Grid.Column="1"  >
                    <TextBlock   Text="{Binding MACHINEID, Mode=TwoWay}"   VerticalAlignment="Top"  Width="100" />
                </WrapPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
            
            <TextBlock Grid.Row="4" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=开始日期:}}" 
                           HorizontalAlignment="Right"   Height="18"      TextWrapping="Wrap"   
                           VerticalAlignment="Top"    TextAlignment="Right"   />
            <DatePicker Height="25" Grid.Column="1"  HorizontalAlignment="Left" Margin="0,2,0,0"  FontSize="16"   Panel.ZIndex="4" 
                            Text="{Binding DTSTART,ElementName=TV}" SelectedDateChanged ="DTSTART_SelectedDateChanged"  />
            <TextBox Grid.Row="4" Grid.Column="1"    Text="{Binding MKFPLDATV, Mode=TwoWay}"   
                         VerticalAlignment="Top" Width="100" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="5" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=开始时间:}}"  HorizontalAlignment="Right"   Height="18"      TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <TextBox Grid.Row="5" Grid.Column="1"    Text="{Binding MKFPLTIME, Mode=TwoWay}"   VerticalAlignment="Top"  Width="100" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="6" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=持续时间:}}"  HorizontalAlignment="Right"   Height="18"      TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <TextBox Grid.Row="6" Grid.Column="1"    Text="{Binding QTY,ElementName=TV, Mode=TwoWay}"   VerticalAlignment="Top"  Width="100" />
            </Grid>      
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="5" Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=结束日期:}}"  HorizontalAlignment="Right"  
                           Height="18"      TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <TextBox Grid.Row="5" Grid.Column="1"    Text="{Binding ENDATE,  Mode=TwoWay}"   
                         VerticalAlignment="Top"  Width="100"  />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="2*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock  Grid.Column="0"  Text="{Binding Source={Localization:Translate Word=结束时间:}}"  HorizontalAlignment="Right" 
                            Height="18"      TextWrapping="Wrap"   VerticalAlignment="Top"     TextAlignment="Right"   />
                <TextBox   Grid.Column="1"    Text="{Binding ENDTIME,Mode=TwoWay}"  
                           VerticalAlignment="Top"  Width="100" />
                <TextBlock Text="{Binding Path=ART, ElementName=TV}" Width="Auto" 
                           Margin="5,0,0,0"></TextBlock>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=重置}}"
                           Margin="0,10,0,5"></TextBlock>
                <Button Height="30" Width="30" Margin="10,0,0,0"  Click="btnRefreshEvents_Click">

                </Button>
            </Grid>
        </StackPanel>   
</me:UIMJOB>
